<% if(request.url.include? '/admin' or request.url.include? '/posts' or request.url.include? '/categories')then%>
<!DOCTYPE html>
<html>
  <head>
    <title>后台管理系统 - <%=SITE_NAME%></title>
    <%= csrf_meta_tags %>
    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" href="/css/pagination.css" type="text/css" media="screen" charset="utf-8"/>
    <style type="text/css">
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <script src="/js/jquery.min.js"></script>
  </head>
  <body>
	<div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="/"><%=SITE_NAME%></a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li><a href="/admin">后台首页</a></li>
              <li<%=raw navclass('/picdata')%>><a href="/admin/picdata">上传图片</a></li>
              <li class="dropdown" line="post">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">文章管理 <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a href="/admin/pagelist">文章列表</a></li>
                  <li><a href="/admin/posting">批量发布</a></li>
                  <li><a href="/categories">类别管理</a></li>
                </ul>
              </li>
              <li<%=raw navclass('/codeparter')%>><a href="/admin/codeparter">代码碎片</a></li>
              <li class="dropdown" line="adminer">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">权限控制 <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a href="/adminers">管理员</a></li>
                  <li><a href="#">权限分配</a></li>
                </ul>
              </li>
              <% if(session[:adminer] != nil) %>
              <li><a href="#contact">个人资料</a></li>
              <li><a href="/admin/logout">退出系统</a></li>
              <% end %>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

	<div class="container">

		<%= yield %>

      <hr/>
      <footer>
        <p>© Company 2012</p>
      </footer>
    </div>

    <script src="/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript">
    $().ready(function(){
      // 权限控制的导航样式
      if(location.href.toString().indexOf('adminer') > 0)
        $('li[line=adminer]').addClass('active');
      if(location.href.toString().indexOf('categories') > 0 || location.href.toString().indexOf('posts') > 0 || location.href.toString().indexOf('/admin/pagelist') > 0 || location.href.toString().indexOf('/admin/posting') > 0)
        $('li[line=post]').addClass('active');
    });
    </script>
  </body>
</html>
<% else %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html> 
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
    <title><%=gettitle%></title><%=raw getkeywords%><%=raw getdesc%>
    <link rel="stylesheet" href="/css/master.css" type="text/css" media="screen" charset="utf-8"/>
    <link rel="stylesheet" href="/css/pagination.css" type="text/css" media="screen" charset="utf-8"/>
    <script src="/js/jquery.min.js"></script>
  </head> 
  <body> 
    <div id='wrapper'> 
      <div id='header' style=""> 
        <h1><a href="/">逗死了</a></h1> 
        <h2>收获快乐，开心生活每一天！</h2> 
      </div>
      <div id='menu'> 
        <ul> 
          <li><a href="/"<%=raw menuclass('/new')%>>最新笑话</a></li> 
          <li><a href="/xiao/"<%=raw menuclass('/xiao')%>>经典小笑话</a></li> 
          <li><a href="/leng/"<%=raw menuclass('/leng')%>>经典爆笑冷笑话</a></li> 
          <li><a href="/chengren/"<%=raw menuclass('/chengren')%>>成人幽默笑话</a></li>
          <li><a href="/tupian/"<%=raw menuclass('/tupian')%>>幽默搞笑图片</a></li>
          <li><a href="/shipin/"<%=raw menuclass('/shipin')%>>幽默搞笑视频</a></li>
        </ul> 
     </div>
      <div id='content'> 
        <%= yield %>
      </div>
      <div id='footer'> 
        <p><a href="/about/" rel="nofollow">关于本站</a>&nbsp;
          <a href="/copyright/" rel="nofollow">版权声明</a>&nbsp;
          <a href="/sitemap/">网站地图</a>&nbsp;
          <a href="/feedback/" rel="nofollow">用户反馈</a>&nbsp;
          <script src="http://s14.cnzz.com/stat.php?id=5016679&web_id=5016679" language="JavaScript"></script>&nbsp;
          <br/>
          <a href="http://www.dousile.com" target="_blank">逗死了</a> - 分享最新的经典小笑话|经典爆笑冷笑话|成人幽默笑话。收获快乐，开心生活每一天！
          <br/><% if @webindex %><%=raw(CodeparterController.getByName 'links') %><%end%>
          <br/>© 2013 <a href="http://www.dousile.com/">www.dousile.com</a></p>  
      </div>
    </div>
    <script type="text/javascript">
    $().ready(function(){
      $('#content .item .text').hover(function(){ $(this).addClass('text_current'); }, function(){ $(this).removeClass('text_current'); });

      $(document).scroll(function(){
          if($(this).scrollTop() > 300) {
            $('#side-pannel a:first div').fadeIn();
          } else {
            $('#side-pannel a:first div').fadeOut();
          }

          var a = $(document).height(); // 获取页面的文档高度
          var b = $(window).height(); // 获取浏览器显示区域的高度
          var c = a - b;
          var d = $(document).scrollTop(); // 获取滚动条到顶部的垂直高度
      });
    });
    </script>
  </body> 
</html>
<% end %>